<?php 
/*
 module:		用户管理
 create_time:	2024-03-12 15:43:18
 author:		
 contact:		
*/

namespace app\api\service;
use app\api\model\Members;
use think\facade\Log;
use think\exception\ValidateException;
use xhadmin\CommonService;

class MembersService extends CommonService {


	/*
 	* @Description  修改
 	*/
	public static function update($where,$data){
		try{
			$res = Members::where($where)->update($data);
		}catch(ValidateException $e){
			throw new ValidateException ($e->getError());
		}catch(\Exception $e){
			abort(config('my.error_log_code'),$e->getMessage());
		}
		return $res;
	}


	/*
 	* @Description  手机号登录
 	*/
	public static function wxLogin($mobile,$returnField){
		try{
		}catch(\Exception $e){
			abort(config('my.error_log_code'),$e->getMessage());
		}
		if(!$res){
			throw new ValidateException('请检查手机号');
		}
		return checkData($res,false);
	}


	/*
 	* @Description  手机号登录
 	*/
	public static function mobileLogin($mobile,$returnField){
		try{
		}catch(\Exception $e){
			abort(config('my.error_log_code'),$e->getMessage());
		}
		if(!$res){
			throw new ValidateException('请检查手机号');
		}
		return checkData($res,false);
	}


	/*
 	* @Description  编辑数据
 	*/
	public static function upAvatars($where,$data){
		try{
			$res = Members::where($where)->update($data);
		}catch(ValidateException $e){
			throw new ValidateException ($e->getError());
		}catch(\Exception $e){
			abort(config('my.error_log_code'),$e->getMessage());
		}
		return $res;
	}




}

